<template>
	<view class="tui-header-search">
		<view class="tui-cell-ico" style="padding-left: 32rpx;" @tap="handleClick">
			<uni-icons type="arrowleft" size="44" color="#fff" class="icon"></uni-icons>
		</view>
		<view v-if="showRight" class="tui-cell-ico" style="text-align: right;padding-right: 32rpx;" @click="shareTop">
			<uni-icons type="redo" color="#fff" size="44"></uni-icons>
		</view>
	</view>
</template>

<script>
	import uniIcons from "../uni-icons/uni-icons.vue"
	
	export default {
		name: 'shareHead',
		props: {
			showRight: {
				type: Boolean,
				default: false
			}
		},
		components:{
			uniIcons
		},
		data() {
			return {}
		},
		methods: {
			handleClick() {
				uni.navigateBack({delta: 1})
			},
			shareTop() {
                this.$api.msg('点击了分享')
			}
		}
	}
</script>

<style lang="scss">
	.tui-header-search {
		display: flex;
		padding-top: 28rpx;
		z-index: 99;
		position: fixed;
		width: 100%;
		
		.tui-cell-ico {
			flex: 1;
			.icon {
				background: rgba(0,0,0,.4);
				padding: 10rpx;
				border-radius: 50%;
			}
		}
	}
</style>
